package com.es.springbootdate_es;

import com.es.springbootdate_es.pojo.Item;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * @author zc
 * @version 1.0
 * @date 2021/9/17 13:55
 */
@SpringBootTest
@RunWith(SpringRunner.class)
public class SpringDataESIndexTest2 {

//    @Autowired
//    private ElasticsearchTemplate elasticsearchTemplate;
//
//    @Test
//    public void testCreate(){
//        // 创建索引，会根据Item类的@Document注解信息来创建
//        elasticsearchTemplate.createIndex(Item.class);
//        // 配置映射，会根据Item类中的id、Field等字段来自动完成映射
//        elasticsearchTemplate.putMapping(Item.class);
//    }
}
